package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class TRiskCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 唯一ID */
    private String id;

    /** 类型名称 */
    @Size(min = 0, max = 60, message = "类型名称长度不能超过60个字符")
    @Excel(name = "类型名称")
    private String caption;

    /** 父类型ID */
    @Excel(name = "父类型ID")
    private String parentid;

    /** 编号 */
    @Excel(name = "编号")
    private String code;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createts;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long createdby;

    /** 公司 */
    @Excel(name = "公司")
    private Long companyid;

    public void setId(String id)
    {
        this.id = id;
    }

    public String getId()
    {
        return id;
    }
    public void setCaption(String caption)
    {
        this.caption = caption;
    }

    public String getCaption()
    {
        return caption;
    }
    public void setParentid(String parentid)
    {
        this.parentid = parentid;
    }

    public String getParentid()
    {
        return parentid;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setCreatets(Date createts)
    {
        this.createts = createts;
    }

    public Date getCreatets()
    {
        return createts;
    }
    public void setCreatedby(Long createdby)
    {
        this.createdby = createdby;
    }

    public Long getCreatedby()
    {
        return createdby;
    }
    public void setCompanyid(Long companyid)
    {
        this.companyid = companyid;
    }

    public Long getCompanyid()
    {
        return companyid;
    }

    /** 子数据 */
    private List<TRiskCategory> children = new ArrayList<TRiskCategory>();

    public List<TRiskCategory> getChildren() {
        return children;
    }

    public void setChildren(List<TRiskCategory> children) {
        this.children = children;
    }

    /*非表字段*/
    public String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("caption", getCaption())
                .append("parentid", getParentid())
                .append("code", getCode())
                .append("createts", getCreatets())
                .append("createdby", getCreatedby())
                .append("companyid", getCompanyid())
                .toString();
    }
}
